<template>
  <el-tabs v-model="activeTab">
    <el-tab-pane v-for="(i, index) in tabs" :key="index" :label="i.label" :name="i.name">
      <Tab :info-type="i.name" :ref="(el) => tabRef.push(el as TabType)" />
    </el-tab-pane>
  </el-tabs>
</template>
<script setup lang="ts">
import Tab from './components/Tab.vue'

type TabType = InstanceType<typeof Tab>

defineOptions({
  name: 'ThirdPartyInformation'
})

const tabs = [
  {
    label: '项目采购信息',
    name: '采购'
  },
  {
    label: '招标项目信息',
    name: '招标'
  },
  {
    label: '中标项目信息',
    name: '中标'
  }
]

const activeTab = ref('采购')
const tabRef = ref<TabType[]>([])

onActivated(() => {
  tabRef.value.forEach((el) => {
    el.getList()
  })
})
</script>
<style lang="scss" scoped></style>
